﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaMusaSoft.RPS.RPSServices.Reports;

namespace BaMusaSoft.RPS.ViewModel.HelperClasses
{
    public class SchedulesComparer:IEqualityComparer<AllSchedulesReportFields>
    {
        public bool Equals(AllSchedulesReportFields x, AllSchedulesReportFields y)
        {
            if (object.ReferenceEquals(x, y)) return true;
            if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) return false;
            return x.ScheduleId == y.ScheduleId;
        }

        public int GetHashCode(AllSchedulesReportFields obj)
        {
            unchecked
            {
                int hash = 17;
                hash = hash * 23 + obj.ScheduleId.GetHashCode();
                return hash;

            }
        }
    }
    public class SchedulesCustomersComparer:IEqualityComparer<SchedulesCustomersReportFields>
    {

        public bool Equals(SchedulesCustomersReportFields x, SchedulesCustomersReportFields y)
        {
            if (object.ReferenceEquals(x, y)) return true;
            if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) return false;
            return x.CustomerId == y.CustomerId;
        }

        public int GetHashCode(SchedulesCustomersReportFields obj)
        {
            unchecked
            {
                int hash = 17;
                hash = hash * 23 + obj.CustomerId.GetHashCode();
                return hash;

            }
        }
    }
    public class SchedulesContractsComparer:IEqualityComparer<SchedulesContractsReportFields>
    {

        public bool Equals(SchedulesContractsReportFields x, SchedulesContractsReportFields y)
        {
            if (object.ReferenceEquals(x, y)) return true;
            if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null)) return false;
            return x.ContractNo == y.ContractNo;
        }

        public int GetHashCode(SchedulesContractsReportFields obj)
        {
            unchecked
            {
                int hash = 17;
                hash = hash * 23 + obj.ContractNo.GetHashCode();
                return hash;

            }
        }
    }
}
